package com.niit.session7.loop;

import java.util.Scanner;

public class UserLogin1 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String username = "trout";
		String password = "123456";
		String user;
		String pass;
//		do...while会先执行后判断，特点是至少执行一次
		do {
			System.out.print("请输入用户名：");
			user = sc.next();
			System.out.print("请输入密码：");
			pass = sc.next();
		}while(!(username.equals(user) && password.equals(pass)));
	System.out.println("登录成功");	
	}

}
